<?php

namespace App\Models\CMS;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class Media extends Model
{
    protected $table ='cms_content_media';
    use SoftDeletes;


    /**
     * @var array
     */
    public $fillable = [
        'title',
        'assets_id',
        'content_id',
        'description',
        'is_auto'
    ];

    public function contents()
    {
        return $this->morphOne(Content::class, 'content_detail');
    }

    public function asset()
    {
        return $this->hasOne(Assets::class, 'id', 'assets_id');
    }
    //
}
